[linux] Fix vsnprintf patch not to write null byte past the end of the buffer.
authorChristian Limpach <Christian.Limpach@xensource.com>
Thu, 4 Jan 2007 15:50:08 +0000 (15:50 +0000)
committerChristian Limpach <Christian.Limpach@xensource.com>
Thu, 4 Jan 2007 15:50:08 +0000 (15:50 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
patches/linux-2.6.16.33/vsnprintf.patch

index 69a93fa5c5ad1331dbfd9494184684efb939300f..3e327739865bb9ab0afa1034fb125b482b7712e1 100644 (file)
@@ -203,7 +203,7 @@ index b07db5c..f595947 100644
 +              if (str < end)
 +                      *str = '\0';
 +              else
-+                      *end = '\0';
++                      end[-1] = '\0';
 +      }
 +      /* the trailing null byte doesn't count towards the total */
        return str-buf;